import App from './App'
import uView from "uview-ui";
import { to, tar, back, redirec } from "utils/route/index.js"

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store,
	...App
})


// 引入uView提供的对vuex的简写法文件
let vuexStore = require('@/store/$u.mixin.js')
Vue.mixin(vuexStore)
// 引入vuex
import store from '@/store';

// http++baseUrl
import httpUrl from '@/common/http.url.js'
// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js'
// http接口API抽离，免于写url或者一些固定的参数
import httpApi from '@/common/http.api.js'

Vue.use(uView);
Vue.prototype.$to = to
Vue.prototype.$tar = tar
Vue.prototype.$back = back
Vue.prototype.$redirec = redirec

Vue.use(httpUrl, app)
Vue.use(httpInterceptor, app)
Vue.use(httpApi, app)

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
